package com.banmao.algorithm.No201To300.No283;

public class Solution2 {

    public static void moveZeroes(int[] nums) {
        // 先通过快慢指针将非零元素和零值交换
        int slow = 0, fast = 0;
        for(; fast <= nums.length - 1; fast++) {
            if(nums[fast] != 0) {
                int temp = nums[slow];
                nums[slow] = nums[fast];
                nums[fast] = temp;
                slow++;
            }
        }

    }

}
